<!DOCTYPE html>
<html>
	<head>
		 <meta charset="UTF-8">
  <meta name="apple-mobile-web-app-capable" content="yes" />
  <meta name="apple-mobile-web-app-status-bar-style" content="black" />
  <meta name="format-detection"content="telephone=no, email=no" />
  <meta name="renderer" content="webkit">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="HandheldFriendly" content="true">
  <meta name="MobileOptimized" content="640">
  <meta name="screen-orientation" content="portrait">
  <meta name="x5-orientation" content="portrait">
  <meta name="full-screen" content="yes">
  <meta name="x5-fullscreen" content="true">
  <meta name="browsermode" content="application">
  <meta name="x5-page-mode" content="app">
  <meta name="msapplication-tap-highlight" content="no">
  <meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no">
		<style type="text/css">
			html, body, div, span, applet, object, iframe, h1, h2, h3, h4, h5, h6, p, blockquote, pre, a, abbr, acronym, address, big, cite, code, del, dfn, em, img, ins, kbd, q, s, samp, small, strike, strong, sub, sup, tt, var, b, u, i, center, dl, dt, dd, ol, ul, li, fieldset, form, label, legend, table, caption, tbody, tfoot, thead, tr, th, td, article, aside, canvas, details, embed, figure, figcaption, footer, header, hgroup, menu, nav, output, ruby, section, summary, time, mark, audio, video { margin: 0; padding: 0; border: 0; font-size: 100%; font: inherit; vertical-align: baseline; }
			body{
				font-family: "microsoft yahei";
			}
			.video{
				width: 100%;
				height: 100%;
				/*display: none;*/
				position: absolute;
				top: 0;
				left: 0;
				z-index: 10000;
			}
			.video video{
				display: none;
			}
			.index{
				display: none;
				position: relative;
				z-index: 1000;
				color: white;
				background-color: #b00000;
			}
			/*首页的p标签*/
			.index_p1{
				font-size: 20px;
				line-height: 20px;
				position: absolute;
				top: 10%;
				left: 10%;
			}
			.index_p2{
				font-size: 30px;
				line-height: 45px;
				position: absolute;
				top: 23%;
				left: 10%;
				width: 80%;
				text-align: center;
			}
			.index_p3{
				position: absolute;
				top: 63%;
				right: 10%;
				font-size: 20px;
				line-height: 30px;
			}
			.index_p4{
				position: absolute;
				top: 68%;
				right: 10%;
				font-size: 20px;
				line-height: 30px;
			}
			.button{
				display: block;
				width: 60%;
				position: absolute;
				left: 20%;
				bottom: 12%;
			}
			.button img{
				width: 100%;
			}
		</style>
	</head>
	<body>
		
		<div class="video">
			<!--<video autoplay id="video1" src="video/newyear.mp4" x5-video-player-type="h5" x5-video-player-fullscreen="true" width="100%" x-webkit-airplay="allow"></video>-->
			<!--<video id="video1" autoplay src="video/1.mp4" x5-video-player-type="h5" x5-video-player-fullscreen="true" width="100%" x-webkit-airplay="allow" preload="" playsinline="" webkit-playsinline=""></video>-->
			 <video autoplay id="video1" src="video/newyear.mp4" x5-video-player-fullscreen="true" x5-video-player-type="h5" width="100%" x-webkit-airplay="allow" preload="" playsinline="" webkit-playsinline=""></video>
		</div>
		
		<div class="index">
			<p class="index_p1"></p>
			<p class="index_p2">
			</p>
			<p class="index_p3">INSIGHT</p>
			<p class="index_p4"></p>
			<a class="button" href="generate.html">
				<img src="img/index.png"/>
			</a>
		</div>
		
		
		<script src="js/jquery-2.1.0.js" type="text/javascript" charset="utf-8"></script>
		<script src="http://res.wx.qq.com/open/js/jweixin-1.0.0.js"></script>
		<script src="http://api.weixin.yao.3xy.me/api/jsapi_js.php?id=8&debug=false"></script>
		<script type="text/javascript">
			//index宽高
			$(document).ready(function() {
				mainliWidth();
				$(window).resize(function() {
					mainliWidth();
				});
				function mainliWidth() {
					var height = document.documentElement.clientHeight;
					$(".index").css("height", height);
				}
			});
			
			//获取是否需要播放视频
			function GetArgsFromHref(sHref, sArgName){
			      var args    = sHref.split("?");
			      var retval = "";
			    
			      if(args[0] == sHref) /*参数为空*/
			      {
			           return retval; /*无需做任何处理*/
			      }  
			      var str = args[1];
			      args = str.split("&");
			      for(var i = 0; i < args.length; i ++)
			      {
			          str = args[i];
			          var arg = str.split("=");
			          if(arg.length <= 1) continue;
			          if(arg[0] == sArgName) retval = arg[1]; 
			      }
			      return retval;
			}
			
			var postid = GetArgsFromHref(window.location.href,'id');	
			var isvideo =GetArgsFromHref(window.location.href,'video');
			
			if(isvideo == "no"){
			  $(".video").hide();
			  $(".index").show();
			  $(".button").hide();
			} 
			
			var _video1 = $("#video1")[0];
//			
			function checkVideo(){
			  if(_video1.readyState == 4){
			  	$("#video1").show();
			  	_video1.play();
			  }
			  setTimeout(checkVideo, 100);
			}
			setTimeout(checkVideo, 100);	

			//视频播放结束
			_video1.addEventListener("ended", function(){
			  $(".video").hide();
			  $(".index").show();
			});
			var _from = '';
			var _to = '';
			var _content= '';
			$.ajax({
				type:"post",
				url:"./app/index.php?c=index&a=getBlessing",
				data:{'id':postid},
				async:false,
				success:function(ret){
					_from = ret.from;
					_to = ret.to;
					_content= ret.content;
					$(".index_p1").html(_from);
					$(".index_p2").html(_content);
					$(".index_p4").html(_to)
				}
			});
			
			
			//微信分享
			var baseUrl = "http://web.idea.3xy.me/vacn20170119_wmxcscb/";
	 		var wxData = {
//		      imgUrl: baseUrl + "html/img/share.png",
		      link: baseUrl + "index.html",
		      desc: "因赛集团祝"+_to+"2017年新年快乐",
		      title: "因赛集团祝"+_to+"2017年新年快乐",
		      share: function() {
		        //获取“分享到朋友圈”按钮点击状态及自定义分享内容接口
		        wx.onMenuShareTimeline({
		          title: wxData.desc,
		          link: wxData.link,
		          imgUrl: wxData.imgUrl,
		          success: function(){
		            // if(wxType == 1){
		            //   shareSuccess()
		            // }
		          },
		          cancel: function(){
		            // 
		          }
		        });
		        //获取“分享给朋友”按钮点击状态及自定义分享内容接口
		        wx.onMenuShareAppMessage({
		          title: wxData.title,
		          desc: wxData.desc,
		          link: wxData.link,
		          imgUrl: wxData.imgUrl,
		          type: '', // 分享类型,music、video或link，不填默认为link
		          dataUrl: '', // 如果type是music或video，则要提供数据链接，默认为空
		          success: function(){
		            // if(wxType == 1){
		            //   shareSuccess()
		            // }
		          },
		          cancel: function(){
		            // 
		          }
		        });
		      },
		      callback: function(){}
		    };
		    
		    wx.ready(function(){wxData.share()});	
		    
		    
		    //wechat视频
			if(window.WeixinJSBridge) {
			  WeixinJSBridge.invoke('getNetworkType', {}, function(e) {
			    _video1.load();
			  });
			}else{
			  document.addEventListener("WeixinJSBridgeReady", function() {
			    WeixinJSBridge.invoke('getNetworkType', {}, function(e) {
			      _video1.load();
			    });
			  }, false);
			}
		</script>
	</body>
</html>
